//  this library.
/// 栏目对应的类型
enum ColumnTypeEnum {
  chapterPractice(desc: "章节练习", code: 1),
  paperLibrary(desc: "试卷库", code: 2),
  specialPractice(desc: "专项练习", code: 3),
  randomFormPaper(desc: "随机组卷", code: 4),
  video(desc: "视频", code: 5),
  materialInfo(desc: "资料", code: 6),
  live(desc: "直播", code: 7),
  // 下面是默认直接显示的,自定义的
  sjxc(desc: "随机小测", code: 101),
  ctjl(desc: "错题记录", code: 102),
  rdst(desc: "热点试题", code: 103),
  ctjx(desc: "错题精选", code: 104),
  wdsc(desc: "我的收藏", code: 105),
  wdbj(desc: "我的笔记", code: 106),
  zx(desc: "最新", code: 107),
  ;

  final String desc;

  final int code;

  const ColumnTypeEnum({
    required this.desc,
    required this.code,
  });

  /// 获取对应的类型
  static ColumnTypeEnum? getColumnType(String type) {
    var values = ColumnTypeEnum.values;
    for (var value in values) {
      if (value.name == type) {
        return value;
      }
    }
    return null;
  }
}
